--[[/**
-- * 
 * 恢复buff来源N生命,
-- */]]

---@class BuffEffect583103 : BaseBuffEffect
BuffEffect583103 = ClientFight.CreateClass("BuffEffect583103", ClientFight.BaseBuffEffect)
local t = BuffEffect583103

---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    if (isDamageActionTrigger(buff))then
        local isBuff = parameters[4];
    if (isBuff) then
    return IBuffEffect.FAIL;
    end
    end
    local result =parameters[3];
    if (not result:isDamage()) then
    return IBuffEffect.FAIL;
    end
    if (not AttackUtils.isDamage(result.state)) then
    return IBuffEffect.FAIL;
    end
    local source = buff.source;
    local addHp = Utils.calcRatio(result.damage,buff.buffBean.f_BuffEffectValue[1]);
    SkillRoleMgr.savePathFile("[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
    .. buff.modelId .. " 恢复buff来源生命: "..addHp);
    DamageManager.setFighterHp(fight,source,buff.target, nil, SkillDamageTypeEnum.HEAL, addHp, source.hp+addHp,true,false,true);
    return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);
end

t.New()